﻿using System;
using Persons;
using PersonClient;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;

namespace PersonsClient_Sample
{
    static class Program
    {
        static void Main()
        {
            var person = new Person(0, "Kurt", "Williams", 31, "", Gender.Male);
            var pClient = new PClient();

            if (pClient.Login("127.0.0.1", 10011))
            {
                Console.WriteLine("Connected");
                if (pClient.Send(person))
                {
                    Console.WriteLine("Sent data");
                    if (pClient.Logout())
                    {
                        Console.WriteLine("Disconnected");
                    }
                }
            }

            Console.Write("\n\nPress Enter to exit...");
            Console.ReadLine();
        }
    }
}
